package com.lmx.web.controller.thirdPart;

import java.io.BufferedOutputStream;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lmx.persistence.service.TenantService;

/*-
 * 处理接口
 */

@Controller
@RequestMapping("/access/tenant")
public class TenantController {
	private static Log logger = LogFactory.getLog(TenantController.class);

	@Autowired
	private TenantService tenantService;

	@RequestMapping("/addSourceData")
	@ResponseBody
	public void bedMatWarningData(HttpServletRequest request, HttpServletResponse response) {
		// 数据处理
		String result = "";
		logger.debug("-----------------------------start addSourceData-------------------------------------");
		tenantService.addAllModeSourceData();
		BufferedOutputStream out;
		try {
			out = new BufferedOutputStream(response.getOutputStream());
			out.write("addSourceData end".getBytes());
			out.flush();
			out.close();
		} catch (Exception e) {
			logger.debug(" addSourceData error " + e);
		}
	}

}
